package Before826.Synchronized;

public class  CountThread extends  Thread{
    private  int i = 0;
    @Override 
    public void  run(){
    try {
        while (i<100){
            System.out.println(this.getName() + "是第" + (i+1) +  "次计数");
            i++;
            sleep(1000);
        }
    }
    catch (InterruptedException e){
        System.out.println("线程结束");
    }
    catch (Exception e){
        e.printStackTrace();
    }

    }
}
